﻿// Copyright (c) 2014 Converter Systems LLC

using ConverterSystems.Windows.Data;
using MahApps.Metro;
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace ConverterSystems.Workstation.Data
{
    [ValueConversion(typeof(Accent), typeof(Brush))]
    public class AccentToBrushConverter : ValueConverter<Accent, Brush>
    {
        protected override Brush Convert(Accent value, object parameter, CultureInfo culture)
        {
            if (value == null) throw new ArgumentNullException("value");
            return value.Resources["AccentColorBrush"] as Brush;
        }
    }
}